package com.zjs.io;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamDemo {
    public static void main(String[] args) {
        FileOutputStream fileOutputStream = null;
        try {
            String path = System.getProperty("user.dir");//获取项目根目录
            fileOutputStream = new FileOutputStream(path+"/date-output/OutputFile.txt");//
//            byte[] buf;
//            buf = "天时达\n爱神的箭".getBytes();
//            fileOutputStream.write(buf);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                if(fileOutputStream != null)
                    fileOutputStream.close();
            }catch (IOException e){
                e.printStackTrace();
            }
        }
    }
}
